package com.mew.user.controller;

import com.mew.common.rest.user.UserDetailedInfoResponseMessage;
import com.mew.user.service.UserInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;


/**
 * @author dylin
 * @create 2021/1/27 0027
 */
@Controller
@RequestMapping("/user")
@Slf4j
public class UserController {
    @Autowired
    private UserInfoService userInfoService;


    /**
     * 获取详细信息 通过uid
     */
    @PostMapping("/detailed_by_uid")
    @ResponseBody
    public UserDetailedInfoResponseMessage getDetailedInfoByUid(@RequestParam("uid")long uid,@RequestParam("qid") long qid){
        return userInfoService.getDetailedInfo(uid,qid);
    }

    /**
     * 获取详细信息 通过gid
     */
    @PostMapping("/detailed_by_gid")
    @ResponseBody
    public UserDetailedInfoResponseMessage getDetailedInfoByGid(@RequestParam("uid")long uid,@RequestParam("gid")String gid){
        return userInfoService.getDetailedInfo(uid,gid);
    }

}
